﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace RunUOGenerator
{
    public partial class UpDownControl : BaseTabControl
    {
        private string _SkipValue = "";

        public UpDownControl()
        {
            InitializeComponent();
            base.Value = "0";
        }

        public string Maximum { get { return numericUpDown.Maximum.ToString(); } set { numericUpDown.Maximum = int.Parse(value); } }

        /// <summary>
        /// Sets or gets the SkipValue of this control.
        /// </summary>
        public string SkipValue
        {
            set{ _SkipValue = value; }
            get{ return _SkipValue; }
        }

        /// <summary>
        /// Sets or gets the Value of this control.
        /// </summary>
        public override string Value
        {
            set { base.Value = value; }
            get 
            {
                string val = "0";

                if (base.Value != "")
                    val = base.Value;

                if (_SkipValue == "")
                    _SkipValue = "0";

                if (int.Parse(base.Value) > int.Parse(_SkipValue))
                {
                    return base.Value;
                }
                else
                {
                    return "-1-";
                }
            }
        }

        private void numericUpDown_ValueChanged(object sender, EventArgs e)
        {
            this.Value = numericUpDown.Value.ToString();
        }

    }
}
